/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package specifications;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.nodes.Tag;

/**
 *
 * @author Jason
 */
public class SpecializedLanguage extends Parameter implements YamlObject<SpecializedLanguage> {
    public static final Tag TAG = new Tag("!SpecializedLanguage");
    private String subjectField;
    private String terminology;
    
    public SpecializedLanguage(){}
    public SpecializedLanguage(String subjectField, String terminology){
        setPriority(20); //default priority
        this.subjectField = subjectField;
        this.terminology = terminology;
    }
    
    @Override
    public ArrayList<Directive> getDirectives() {
        return new ArrayList(0);
    }

    @Override
    public void dump(String filename) throws IOException {
        Yaml yaml = new Yaml(CONSTRUCTOR, REPRESENTER);
        FileWriter writer = new FileWriter(filename);
        writer.write(yaml.dumpAs(this, TAG, DumperOptions.FlowStyle.BLOCK));
        writer.close();
    }

    @Override
    public SpecializedLanguage load(String filename) throws IOException {
        Yaml yaml = new Yaml(CONSTRUCTOR, REPRESENTER);
        FileReader reader = new FileReader(filename);
        SpecializedLanguage param = yaml.loadAs(reader, SpecializedLanguage.class);
        reader.close();
        return param;
    }

    /**
     * @return the subjectField
     */
    public String getSubjectField() {
        return subjectField;
    }

    /**
     * @param subjectField the subjectField to set
     */
    public void setSubjectField(String subjectField) {
        this.subjectField = subjectField;
    }

    /**
     * @return the terminology
     */
    public String getTerminology() {
        return terminology;
    }

    /**
     * @param terminology the terminology to set
     */
    public void setTerminology(String terminology) {
        this.terminology = terminology;
    }
    
}
